package com.ssm.user.event;

import lombok.Data;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

@Getter //当类中没有默认的构造函数时(继承ApplicationEvent后，重写构造方法)不能使用@Data注解
//想要get到PersonChangeEvent类中的属性可加@Getter注解来实现
public class PersonChangeEvent extends ApplicationEvent { //自定义event要继承ApplicationEvent(发布事件时对象要为ApplicationEvent，所以继承)

    private Person person;

    private String op;

    public PersonChangeEvent(Person person, String op) {
        super(person);
        this.person = person;
        this.op = op;
    }

}
